1. Field of the Invention
The present invention relates to a method and system for processing data. More particularly, it relates to an apparatus for processing data, memory bank used therefor, semiconductor device, and method for reading out pixel data.
2. Description of Related Art
As related art, a motion vector composed of both the magnitude and the direction of a motion of an object in the pictures generated at different times has been used to process a moving picture. In a high-performance coding of a picture, the motion vector has been used for the coding for motion compensation and estimation.
Block-matching method has been known as one of the ways to detect the motion vector. According to this method, a candidate block that is most matched with a reference block in a reference frame is found out of the candidate blocks with them being separately set within a predetermine search area, thereby obtaining a motion vector.
FIG. 1 illustrates a case where, if a current target frame is referred as a reference frame RF, a motion vector is directed toward a search frame SF that is preceded by one frame, for example, from the reference frame RF; FIG. 1A shows the reference frame RF as the target frame and FIG. 1B shows the search frame SF.
Pixel data in the reference frame RF is first divided into multiple pixel blocks. Sizes of respective divided pixel blocks are identical to each other. Herein, the size of divided pixel blocks is set to four by four pixels.
One pixel block is selected from the multiple pixel blocks in the reference frame RF as the reference block RB. It will be described how to get a motion vector in reference to the reference block RB.
In pixel data of the search frame SF, a search area SA having a size is set with the middle of the search area being coincident with the reference block RB of the reference frame RF. Pixel blocks each having the same size as that of the reference block RB are set in the search area SA as candidate blocks CB.
By comparing multiple items of pixel data (four by four pixels) forming each candidate block CB within the search area SA of the search frame SF with multiple items of pixel data (four by four pixels) forming the reference block RB of the reference frame RF, absolute difference of pixel data between the corresponding pixels is obtained. This absolute difference of each pixel is summed so that a sum of the absolute difference for each candidate block can be obtained.
Multiple candidate blocks CB exist in the search area SA. The sum of the absolute difference for every candidate block that can be set within the search area SA is calculated. If the search area SA has a size with twelve by twelve pixels, maximum number of the candidate blocks CB that can be set within the search area SA is calculated as 9*9=81. Thus, 81 sums of the absolute difference are calculated for one reference block RB.
In a memory for storing picture data, its address arithmetic portion sequentially calculates the addresses for allowing items of pixel data in relation to the reference block RB and the candidate block CB that is subject to a comparison therewith to be read out. The memory is accessed according to the address thus calculated so that it can read items of the desired pixel data and compare them. Address of each candidate block CB is calculated with a candidate block CB being transferred and set within the search area SA. Thus, the pixel data is entirely read out for each of the candidate blocks CB and the read pixel data is repeatedly compared with that of the reference block RB, thereby obtaining a sum of the absolute difference for each candidate block CB.
Relative location of the candidate block having minimum value of sum of the absolute difference among the sums of the absolute difference thus obtained against the reference block RB is set to a motion vector of the corresponding reference block RB.
According to the block-matching method, pixel data of which the candidate block is composed is always read out of the memory sequentially. Rate of reading data out of a memory is usually slower as compared with operating speed of other logic circuits. An arithmetic processing speed of the block-matching method is limited to memory access speed.
According to the above block-matching method, the memory is accessed with the addresses to which the pixel data of the reference block RB and the pixel data of each of the candidate blocks CB in the search area SA are read being calculated. Thus, complex control of addressing is required. This results in a large size of circuitry.
Thus, an object of the present invention is to provide a data processing apparatus for processing the picture, memory bank used therefor, semiconductor device, and method for reading out pixel data, in order to shorten processing time for obtaining a motion vector.
Another object of the present invention is to provide a data processing apparatus having a simple circuit configuration for processing a picture at a high speed to easily implement data access as a block unit with a limited size of circuitry, by reading desired data out of the memory with picture data being shifted using memory device having a cyclic shift configuration to compare the read data.